import React, { useState } from 'react';
import { Slider, View, Text } from 'react-native';

const AudioPlayer = ({ currentTrack }) => {
  const [position, setPosition] = useState(0);

  return (
    <View>
      <Text>{currentTrack.title}</Text>
      <Slider
        value={position}
        onValueChange={setPosition}
        maximumValue={currentTrack.duration}
      />
      <View style={styles.controls}>
        <Text onPress={play}>播放</Text>
        <Text onPress={pause}>暂停</Text>
        <Text onPress={next}>下一首</Text>
      </View>
    </View>
  );
};

export default AudioPlayer;